import numpy as np
def a1():
    a=np.array([770.0,820,900])
    print(a*0.75*2+300)

a=np.zeros((17296,3))
b=np.zeros((7771,3))
heavyK=np.array([1994,2104,2280])
mediumK=np.array([1455,1530,1650])
result = np.array([0,0,0,0,0,0])

def getSum(a=np.array([0,0,0]),b=np.array([0,0,0])):
    return 1-(0.86**a[0])*(0.80**a[1])*(0.75**a[2])*(0.88**b[0])*(0.82**b[1])*(0.84**b[2])

def showall(max=45,matrix=np.zeros((1,3))):
    n=0
    for i in range(max+1):
        sumMax1=max-i
        for j in range(sumMax1+1):
            sumMax2=sumMax1-j
            for k in range(sumMax2+1):
                matrix[n,0]=i
                matrix[n,1]=j
                matrix[n,2]=k
                # print(n,i,j,k)
                n+=1
    print(n)

def function(heavy=np.zeros((1,3)),medium=np.zeros((1,3))):
    a=sum(heavy*heavyK+medium*mediumK)
    if(a>140000):
        return False
    else:
        return True

def testLoop(a=np.zeros((3,3)),b=np.zeros((3,3))):
    n=0
    lines=0
    gmax=0
    for i in a:
        for j in b:
            if(function(i,j)):
                n+=1
                g=getSum(i,j)
                if(g>gmax):
                    gmax=g
                    # print("sssssssss",i,j,i[0],result[0])
                    result[0]=i[0]
                    result[1]=i[1]
                    result[2]=i[2]
                    result[3]=j[0]
                    result[4]=j[1]
                    result[5]=j[2]
        lines+=1
        print(lines,result,i,j,g,gmax)
    print("output:",n,result)

if __name__ =="__main__":
    # a1()
    showall(45,a)
    showall(34,b)
    print(a[1],b[1])
    g=getSum(a[1],b[1])
    print(g)
    testLoop(a,b)